package com.jt.controller;

import com.jt.pojo.ItemParam;
import com.jt.service.ItemParamService;
import com.jt.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dc
 * @Classname ItemParamController
 * @Date 2020/3/22 10:40
 */
@RestController
@RequestMapping("item/param/item")
public class ItemParamController {
    @Autowired
    ItemParamService itemParamService;


    /**
     * 根据商品id查询商品参数
     * @param itemId
     * @return
     */
    @RequestMapping("/query/{itemId}")
    public SysResult getItemParam(@PathVariable Long itemId){
        ItemParam itemParam = itemParamService.getItemParamByItemId(itemId);
        return SysResult.success(itemParam);
    }
}
